import { createRouter, createWebHistory } from 'vue-router'
//404页面
import NotFound from '@/views/error/NotFound.vue'
//无权限页面
import NotAccess from '@/views/error/NoAccess.vue'
//登录页
import LoginView from '@/views/LoginView.vue'
//首页
import IndexView from '@/views/IndexView.vue'
import GeneratorView from '@/views/generator/GeneratorView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/generator',
    },
    {
      path: '/login',
      name: 'LoginView',
      component: LoginView,
    },
    {
      path: '/index',
      name: 'IndexView',
      component: IndexView,
    },
    {
      path: '/generator',
      name: 'generator',
      component: GeneratorView,
    },
    {
      path: '/404',
      name: 'NotFound',
      component: NotFound,
    },
    {
      path: '/403',
      name: 'NotAccess',
      component: NotAccess,
    },
    { path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound },
  ],
})

export default router
